#ifndef _SEARCHWINDOW_INCLUDED_
#define _SEARCHWINDOW_INCLUDED_

#include "types.hpp"
#include "fs.hpp"
#include "search.hpp"

class Ui_Search;
class SearchWindow:public QDialog
{
	Q_OBJECT

	enum State{
		Ready,
		Working,
		Finished,
	};

	FS fs;
	Enumerator er;
	Search search;
	State state;
	Ui_Search *ui;
	Task task;
	QList<QString> files;
	QList<Hit> hits;
	QTextDocument doc;

public:
	SearchWindow(Task task = Task(), QWidget *parent = 0);
	virtual ~SearchWindow();

public slots:
	void updateProgress(int pos);
	void addHit(Hit* hit);
	void enumerated();
	void searched();
	void runPressed();
};

#endif //_SEARCHWINDOW_INCLUDED_
